package com.zhiyou.app.pojo.enums;


import java.util.Arrays;

/**
 * @Description 设备类型枚举
 * @Author : bind
 * @Date : 2022-06-14 14:41
 */
public enum DeviceTypeEnum {

    /**
     *
     */
    miniapp("miniapp", "小程序"),
    app("app", "app"),
    web("web", "网页");

    public String code;
    public String name;

    DeviceTypeEnum(String code, String name) {
        this.code = code;
        this.name = name;
    }

    public static boolean contains(String s) {
        return Arrays.stream(DeviceTypeEnum.values()).map(DeviceTypeEnum::toString).anyMatch(s::equals);
    }

    @Override
    public String toString() {
        return String.valueOf(this.code);
    }
}
